//
//  NSString+ZHCategory.h
//  CaiFuXin
//
//  Created by YANG on 16/10/17.
//  Copyright © 2016年 Yang Zhonghua. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NSString (ZHCategory)

/**判断是非是电话号码*/
+ (BOOL)valiMobile:(NSString *)mobile;

/**获取给定时间搓的值*/
+ (NSString *)getTimeToShowWithTimestamp:(NSString *)timestamp;

/**设置某个字符串的样式*/
+ (NSMutableAttributedString *)attributedText:(NSString *)string  Color:(UIColor *)color  font:(UIFont *)font range:(NSRange)range;

/**给金额字符串添加分割标示，例：33，345，434.98*/
+(NSString *)ResetAmount:(NSString *)Amount_str segmentation_index:(int)segmentation_index segmentation_str:(NSString *)segmentation_str;



/**掉头反转字符串*/
- (NSString *)StringReverse;
//编码反编码
-(NSString *)EncodingString;
-(NSString *)RemovingEncoding;

#pragma mark - string of size
- (CGSize)sizeWithFont:(UIFont *)font;
- (CGSize)sizeWithFont:(UIFont *)font andMaxW:(CGFloat)maxW;
- (CGSize)sizeWithFont:(UIFont *)font andMaxSize:(CGSize)maxSize;
#pragma mark - nil NULL "space"
+(BOOL)isNULL:(id)string;

- (BOOL)isNull;

#pragma md5
- (NSString *)MD5string;
/*
 把JSON格式的字符串转换成字典
 */
- (NSDictionary *)StringOfJsonConversionDictionary;
/**
 *  字符串添加图片
 */
-(NSMutableAttributedString *)insertImg:(UIImage *)Img atIndex:(NSInteger )index IMGrect:(CGRect )IMGrect;
/**
 *  不同颜色不同字体大小字符串
 */
-(NSMutableAttributedString *)setOtherColor:(UIColor *)Color font:(CGFloat)font forStr:(NSString *)forStr;

/**
 *  不同颜色不同字体字体颜色和背景颜色字符串
 */
-(NSMutableAttributedString *)setTextColor:(UIColor *)color bgColor:(UIColor *)bgColor forStr:(NSString *)forStr;
/*
 在文字上添加删除线（例如过去的价格）
 */
-(NSAttributedString *)AddRemoveLineOnStringRange:(NSRange )range lineWidth:(NSInteger )lineWidth;

- (BOOL)isChinese;
- (NSString *)pinyin;
- (NSString *)pinyinInitial;

- (BOOL)isEmail;
- (BOOL)isPhoneNumber;
- (BOOL)isDigit;
- (BOOL)isNumeric;
- (BOOL)isUrl;
- (BOOL)isMinLength:(NSUInteger)length;
- (BOOL)isMaxLength:(NSUInteger)length;
- (BOOL)isMinLength:(NSUInteger)min andMaxLength:(NSUInteger)max;
- (BOOL)isEmpty;

/** 把数字以万计*/
- (NSString *)getMyriadNumber;
/**判断身份证号 */
- (BOOL)judgeIdentityStringValid;

@end
